<?php
// +------------------------------------------------------------------------------	
//	@desc Globlal Setting For the Website
//  @date Wed Aug 19 CST 2009
//  @author Fly Jin <flysharping@gamil.com>
// +------------------------------------------------------------------------------
	session_start();
	define('DS', DIRECTORY_SEPARATOR);
	define('DOMAIN', $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : 'localhost');
	define('T', 'dev_');

	define('DIR_ROOT',		dirname(dirname(__FILE__)).DS);
	define('DIR_APP',		'App');
	define('DIR_LIB',		'Lib');
	define('DIR_UP',		'Upload');
	define('DIR_UP_IMG',	'Images');

	define('URL_ROOT',		'http://'.DOMAIN.'/');
	define('URL_JS',		URL_ROOT.'Js/');
	define('URL_CSS',		URL_ROOT.'Css/');
	define('URL_IMAGES',	URL_ROOT.'Images/');
	define('URL_UPLOAD',	URL_ROOT.DIR_UP.'/');
	define('URL_UP_IMAGES',	URL_UPLOAD.DIR_UP_IMG.'/');

	define('PATH_LIB',		DIR_ROOT.DIR_LIB.DS);
	define('PATH_APP',		DIR_ROOT.DIR_APP.DS);	
	define('PATH_SPRING',	DIR_ROOT.'Spring'.DS);
	define('PATH_CLASS',	PATH_SPRING.'Core'.DS);
	define('PATH_CONTROLLER',DIR_ROOT.DIR_APP.DS.'Controller'.DS);
	define('PATH_MODEL',	DIR_ROOT.DIR_APP.DS.'Model'.DS);
	define('PATH_VIEW',		DIR_ROOT.DIR_APP.DS.'View'.DS);
	define('PATH_CONFIG',	DIR_ROOT.'Config'.DS);
	define('PATH_UP',		DIR_ROOT.DIR_UP.DS);
	define('PATH_UP_IMAGES',PATH_UP.DIR_UP_IMG.DS);

	define('CHARSET', 'utf-8');
	header("content-type:text/html;charset=".CHARSET);
	if (strstr(DOMAIN, 'w.dev.com')) {
		error_reporting(E_ALL & ~E_NOTICE);
		define('DEBUG', 0); 
	}else{
		error_reporting(E_ALL & ~E_NOTICE);
		define('DEBUG', false);
	}

	date_default_timezone_set('PRC');
	$s = PATH_SEPARATOR;
	ini_set('include_path', ini_get('include_path').$s.PATH_CLASS.$s.PATH_CONTROLLER.$s.PATH_LIB.'Smarty'.$s. PATH_INCLUDE .  'PHPExcel'.DS.'Classes');
?>